var Recharge = {//结账退款初始化
    id: "RechargeTable",	//表格id
    seItem: null,		//选中的条目
    table: null,
    layerIndex: -1
};
var mylay;

function _cellStyles(value, row, index) {
    if (row.dealStatus === "已结账") {
        return {css: {"background-color": "#FFF3DC", "overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis"}}
    } else if (row.dealStatus === "审核未通过") {
        return {css: {"background-color": "#FFD1D7", "overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis"}}
    } else if (row.dealStatus === "待审核") {
        return {css: {"background-color": "#FDE2E6", "overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis"}}
    } else {
        return {css: {"overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis"}}
    }
}

function _formatter(value, row, index) {
    return '<span title="' + value + '">' + value + '</span>'

}

function _formatterTime(value, row, index) {
    if (value != null && value !== "") {
        return value.substring(0, 19);
    } else {
        return "";
    }
}

Recharge.initColumn = function () {//初始化表格的列
    var columns = [
        {field: 'selectItem', radio: true},
        {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle', width: '50px'},
        {title: '', field: 'customerSexHead ', visible: false, align: 'center', valign: 'middle'},
        {title: 'checkStatus', field: 'checkStatus', visible: false, align: 'center', valign: 'middle', width: '50px'},
        {title: 'customerId', field: 'customerId', visible: false, align: 'center', valign: 'middle', width: '50px'},
        {title: 'reservationsId', field: 'reservationsId', visible: false, align: 'center', valign: 'middle', width: '50px'},
        {
            title: '客户姓名', field: 'customerName', align: 'center', valign: 'middle', sortable: true, width: 130,
            formatter: function (value, row, index) {
                if (row.accountArrears > 0) {
                    return "<a href='javascript:;' style='display: flex;align-items: center;' onclick = 'Recharge.openBileeRecharge(" + '"' + row.customerId + '"' + ")' ><img src='" + row.customerSexHead + "' alt='' width='40px'><span style='color: red' class='portraitHeadName'>" + value + "</span></a>"
                } else {
                    return "<a href='javascript:;' style='display: flex;align-items: center;' onclick = 'Recharge.openBileeRecharge(" + '"' + row.customerId + '"' + ")' ><img src='" + row.customerSexHead + "' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                }
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '客户电话', field: 'customerPhone', align: 'center', valign: 'middle', sortable: true, width: 135,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '性别', field: 'customerSex', align: 'center', valign: 'middle', sortable: true, width: 80,
            formatter: function (value, row, index) {
                var sexValue = value === 1 ? '男' : value === 2 ? '女' : '未知';
                    return sexValue;
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '年龄', field: 'customerAge', align: 'center', valign: 'middle', sortable: true, width: 80,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '客户状态', field: 'customerStatus', align: 'center', valign: 'middle', width: 110,
            formatter: function (value, row, index) {
                if(row.checkStatus == 1){
                        return '<span title="' + value + '">' + value + '<span style="color: white;background: #FF7E00;padding: 0 3px;border-radius: 50%;margin-left: 4px;">查</span></span>'
                }else {
                        return '<span title="' + value + '">' + value + '</span>'
                }
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '财务应收', field: 'foldingPay', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                if (row.isDo == 5) {  //财务应收=应收-本次优惠抵扣
                        return (parseFloat(row.foldingPay) - parseFloat(row.deductionAmount)).toFixed(2);
                } else if (row.isDo == 3) {   //财务应收= -本次优惠抵扣(假钱)
                        return (-parseFloat(row.deductionAmount).toFixed(2));
                } else if (row.isDo == 4) {  //财务应收=实收+欠费变动
                        return (parseFloat(row.serviceActualPay) + parseFloat(row.accountArrears2) + parseFloat(row.depositAmount)).toFixed(2);
                }
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '应收', field: 'foldingPay', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                if (row.isDo == 5) {  //应收=实收+优惠抵扣+欠费
                        return (parseFloat(row.serviceActualPay) + parseFloat(row.accountArrears2) + parseFloat(row.deductionAmount) + parseFloat(row.depositAmount)).toFixed(2);
                } else if (row.isDo == 3) {  //-本次优惠抵扣(假钱)
                        return 0;
                } else if (row.isDo == 4) {  //应收=实收+欠费变动
                        return (parseFloat(row.serviceActualPay) + parseFloat(row.accountArrears2) + parseFloat(row.depositAmount)).toFixed(2);
                }
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '实收', field: 'serviceActualPay', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                if (row.isDo == 5) {  //实收=实付+储值抵扣
                        return (parseFloat(row.serviceActualPay) + parseFloat(row.depositAmount)).toFixed(2);
                } else if (row.isDo == 3) {   //实收（现金流）=本次实付
                        return (parseFloat(row.serviceActualPay) + parseFloat(row.depositAmount)).toFixed(2);
                } else if (row.isDo == 4) {  //实收=-本单退费额；
                        return (parseFloat(row.serviceActualPay) + parseFloat(row.depositAmount)).toFixed(2);
                }
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '欠费变动', field: 'accountArrears2', align: 'center', valign: 'middle', width: 110, sortable: true,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '财务欠收', field: 'accountArrears', align: 'center', valign: 'middle', width: 110, sortable: true,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '优惠抵扣', field: 'deductionAmount', align: 'center', valign: 'middle', width: 110, sortable: true,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '收费类型', field: 'isDo', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                var sexValue = value === '3' ? '还欠款' : value === '4' ? '退款' : value === '5' ? '消费' : value === '9' ? '储值变动' : '其他';
                    return sexValue;
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '状态', field: 'dealStatus', align: 'center', valign: 'middle', sortable: true, width: 100,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '单据号', field: 'documentNumber', align: 'center', valign: 'middle', sortable: true, width: 100,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: 'tc姓名', field: 'tcName', align: 'center', valign: 'middle', sortable: true, width: 100,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '一级渠道', field: 'oneChannel', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '二级渠道', field: 'twoChannel', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '三级渠道', field: 'thrChannel', align: 'center', valign: 'middle', sortable: true, width: 130,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '首次开单时间', field: 'operationTime', align: 'center', valign: 'middle', sortable: true, width: 170,
            formatter: function (value, row, index) {
                return _formatterTime(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '开单时间', field: 'getTime', align: 'center', valign: 'middle', sortable: true, width: 170,
            formatter: function (value, row, index) {
                return _formatterTime(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '结账时间', field: 'rechargeTime', align: 'center', valign: 'middle', sortable: true, width: 170,
            formatter: function (value, row, index) {
                return _formatterTime(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '开单备注', field: 'remarks', align: 'center', valign: 'middle', sortable: true, width: 120,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        },
        {
            title: '结账备注', field: 'remarksjz', align: 'center', valign: 'middle', sortable: true, width: 120,
            formatter: function (value, row, index) {
                return _formatter(value, row, index);
            },
            cellStyle: function (value, row, index) {
                return _cellStyles(value, row, index);
            }
        }
    ];
    return columns;
};

Recharge.openBileeRecharge = function (ide) {//点击表格姓名查看患者详情
    $.ajax({
        url: Feng.ctxPath + "/consultantTwo/getdcsByCustomerId",
        type: "post",
        data: {
            "id": ide
        },
        success: function (data) {
            if (data == 1) {
                var index = layer.open({
                    type: 2,
                    title: '到店客户详情',
                    area: ['100%', '100%'],
                    fix: true,
                    maxmin: true,
                    content: Feng.ctxPath + '/customerDetails/to_openBileLists/' + ide + "/3"
                });
                this.layerIndex = index;
            } else {
                alert("请先联系前台客服匹配建档！");
                return;
            }
        }
    });
};

Recharge.check = function () { // 检查是否选中
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if (selected.length == 0) {
        Feng.info("请先选中表格中的某一记录！");
        return false;
    } else {
        Recharge.seItem = selected[0];
        return true;
    }
};

Recharge.inquire = function () {//刷新 + 统计
    Recharge.search();
    Recharge.total();
};

Recharge.search = function () {//查询结账退款列表
    Recharge.table.refresh({query: Recharge.formParams()});
};

Recharge.formParams = function () {//查询表单提交参数对象 @returns {{}}
    var queryData = {};
    queryData['reach'] = parent.$("#doctorTcInputPublics").val().trim();
    queryData['abbreviation'] = $("#abbreviation", parent.document).val();
    queryData['startTime'] = $("#startTime").val();
    queryData['endTime'] = $("#endTime").val();
    queryData['dealStatus'] = $("#dealStatus").val();
    queryData['customerStatus'] = $("#customerStatus").val();
    queryData['oneChannel'] = $("#oneChannel").val();
    queryData['twoChannel'] = $("#twoChannel").val();
    queryData['thrChannel'] = $("#thrChannel").val();
    return queryData;
};

Recharge.total = function () {//人数统计
    var startArrivalTimeTwo = $("#startTime").val();
    var reach = parent.$("#doctorTcInputPublics").val()
    var endArrivalTimeTwo = $("#endTime").val();
    var dealStatus = $("#dealStatus").val();
    var oldOneChannelValue = $("#oneChannel").val();
    var oldTwoChannelValue = $("#twoChannel").val();
    var oldThrChannelValue = $("#thrChannel").val();
    $.ajax({
        type: "GET",
        url: Feng.ctxPath + "/recharge/rechargeTotal",
        data: {
            startArrivalTimeTwo: startArrivalTimeTwo,
            endArrivalTimeTwo: endArrivalTimeTwo,
            dealStatus: dealStatus,
            reach: reach,
            oldOneChannelValue: oldOneChannelValue,
            oldTwoChannelValue: oldTwoChannelValue,
            oldThrChannelValue: oldThrChannelValue
        },
        dataType: "json",
        success: function (data) {
            $("#total").html(data[0].countNum);//总人数
            $("#first").html(data[1].countNum);//新客首次
            $("#two").html(data[2].countNum);//新客二次
            // $("#further").html(data[3].countNum);//复诊
            $("#old").html(data[3].countNum);//老客
        }
    });
};

Recharge.recharge = function () {//结账
    if (this.check()) {
        var auditswitch = $("#auditswitch").val();  //开单是否需要审批(1 需要  2 不需要)
        if (auditswitch == 1 && Recharge.seItem.dealStatus == '待审核') {  //需要审核
            alert("此单正在审核中，不能结账！");
            return;
        }
        if (Recharge.seItem.dealStatus == '审核未通过') {  //需要审核
            alert("此单审核未通过，不能结账！");
            return;
        }
        if (Recharge.seItem.dealStatus != "已结账") {
            var date = new Date();
            var currentYear = date.getFullYear();       // 当前年份
            var currentMonth = date.getMonth() + 1;    // 当前月份
            var currentDay = date.getDate();         // 今日日期 几号
            if (currentMonth < 10) currentMonth = "0" + currentMonth;
            if (currentDay < 10) currentDay = "0" + currentDay;
            var currentTime = currentYear + "-" + currentMonth + "-" + currentDay;
            var getTime = Recharge.seItem.getTime;
            $.ajax({
                url: Feng.ctxPath + "/recharge/getOpenBillData",
                type: "post",
                data: {
                    "id": Recharge.seItem.id
                },
                success: function (data) {
                    if (data == 0) {
                        alert("开单项目已更改，请联系开单人重新结账！");
                        window.location.reload();
                    } else {
                        if (getTime.substring(0, 10) == currentTime) {
                            mylay = layer.open({
                                type: 2,
                                title: '结账',
                                area: ['90%', '90%'], //宽高
                                fix: true, //不固定
                                maxmin: true,
                                content: Feng.ctxPath + '/recharge/to_checkoutMethod/' + Recharge.seItem.id
                            });
                            this.layerIndex = mylay;
                        } else {
                            alert("请联系tc重新提交开单！");
                        }
                    }
                },
                error: function (data) {
                    alert('没有权限，请联系系统管理员!');
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                }
            });
        } else {
            alert("此单已结账！");
        }
    }
};

Recharge.resetSearch = function () {
    $("#oneChannel").val("请选择");
    $("#twoChannel").val("请选择");
    $("#thrChannel").val("请选择");
    $("#customerStatus").val("");
    parent.$("#doctorTcInputPublics").val("");
    $("#startTime").val("");
    $("#endTime").val("");
    Recharge.search();
};

Recharge.print = function () {
    if (this.check()) {
        if (Recharge.seItem.dealStatus != "已结账") {
            alert("该单据没有成交，不能打印！");
            return;
        }
        var index = layer.open({
            type: 2,
            title: '打印收费单据',
            area: ['60%', '95%'], //宽高
            fix: true, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/consultant/to_print/' + Recharge.seItem.id
        });
        this.layerIndex = index;
    }
};

Recharge.delete = function () {
    if (this.check()) {
        if (this.seItem.dealStatus == "已开单" || this.seItem.dealStatus == "待审核") {
            var r = confirm("是否删除此单？")
            if (r == true) {
                var ajax = new $ax(Feng.ctxPath + "/recharge/delete/" + this.seItem.id, function (data) {
                    Feng.success("删除成功!");
                    Recharge.table.refresh();
                }, function (data) {
                    alert("没有权限，请联系系统管理员！");
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                });
                ajax.start();
            } else {
            }
        } else {
            alert("只能删除已开单项目");
            return false;
        }
    }
};

Recharge.updateTime = function () {
    if (this.check()) {
        var reservationsId = Recharge.seItem.reservationsId;
        var time = Recharge.seItem.getTime;
        var ids = reservationsId + "," + time
        if (Recharge.seItem.dealStatus != "已结账") {
            alert("该单据没有成交，不能修改！");
            return;
        }
        var index = layer.open({
            type: 2,
            title: '修改时间',
            area: ['40%', '50%'], //宽高
            fix: true, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/recharge/update_time/' + ids
        });
        this.layerIndex = index;
    }
};

Recharge.updateTC = function () {
    if (this.check()) {
        var customerId = Recharge.seItem.customerId;
        var tcName = Recharge.seItem.tcName;
        var ids = customerId + "," + tcName
        if (Recharge.seItem.dealStatus != "已结账") {
            alert("该单据没有成交，不能修改！");
            return;
        }
        var index = layer.open({
            type: 2,
            title: '修改TC',
            area: ['40%', '50%'], //宽高
            fix: true, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/recharge/update_tcName/' + ids
        });
        this.layerIndex = index;
    }
};

Recharge.updateDocumentNumber = function () {
    if (this.check()) {
        var customerId = Recharge.seItem.customerId;
        var time = Recharge.seItem.getTime;
        var ids = customerId + "," + time
        if (Recharge.seItem.dealStatus != "已结账") {
            alert("该单据没有成交，不能修改！");
            return;
        }
        var index = layer.open({
            type: 2,
            title: '修改时间',
            area: ['40%', '50%'], //宽高
            fix: true, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/recharge/update_documentNumber/' + ids
        });
        this.layerIndex = index;
    }
};

Recharge.updateRechargeRemarks = function () {
    if (this.check()) {
        if (Recharge.seItem.dealStatus != "已结账") {
            alert("该单没有成交，不能修改备注！");
            return;
        }
        var reservationsId = Recharge.seItem.reservationsId;
        var rechargeTime = Recharge.seItem.rechargeTime;
        var remarksjz = Recharge.seItem.remarksjz;
        if(remarksjz==null || remarksjz==""){
            remarksjz =1;
        }
        var ids = reservationsId + "," + rechargeTime + "," + remarksjz;
        var index = layer.open({
            type: 2,
            title: '修改备注',
            area: ['40%', '50%'], //宽高
            fix: true, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/recharge/updateRechargeRemarks/' + ids
        });
        this.layerIndex = index;
    }
};

Recharge.close = function () {
    parent.layer.close(parent.layer.getFrameIndex(window.name));
};

Recharge.totalNumber = function (obj) {
    $("#customerStatus").val(obj);
    var queryData = {};
    queryData['startTime'] = $("#startTime").val();//到诊开始时间
    queryData['endTime'] = $("#endTime").val();//到诊结束时间
    queryData['oneChannel'] = $("#oneChannel").val();// 一级渠道
    queryData['twoChannel'] = $("#twoChannel").val();//二级渠道
    queryData['thrChannel'] = $("#thrChannel").val();//三级渠道
    queryData['dealStatus'] = $("#dealStatus").val();//开单状态
    queryData['customerStatus'] = obj; //加入客户状态，总人数
    Recharge.table.refresh({query: queryData});
};

Recharge.naturalDaySearch = function (obj) {
    if (obj == 1) {
        $("#startTime").val(setDateTime(new Date(), 0) + " " + "00:00:00");
        $("#endTime").val(setDateTime(new Date(), 0) + " " + "23:59:59");
        $(".timeBox > div button").eq(0).addClass('actionClick').siblings().removeClass('actionClick');
    } else if (obj == 2) {
        var AccountsTime = $("#sttleAccountsTime").val();
        $("#startTime").val(setDateTime(new Date(), 1) + " " + AccountsTime);
        $("#endTime").val(setDateTime(new Date(), 0) + " " + AccountsTime);
        $(".timeBox > div button").eq(1).addClass('actionClick').siblings().removeClass('actionClick');
    }
    Recharge.inquire();
};

$("#doctorTcSearchAlls", parent.document).click(function () {//主页搜索
    Recharge.search();
    Recharge.total();
});

Recharge.numdos = function () {
    if (obj.value != '' && obj.value.substr(0, 1) == '.') {//修复第一个字符是小数点 的情况.
        obj.value = "";
    }
    obj.value = obj.value.replace(/^0*(0\.|[1-9])/, '$1');//解决 粘贴不生效
    obj.value = obj.value.replace(/[^\d.]/g, "");  //清除“数字”和“.”以外的字符
    obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
    obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数
    if (obj.value.indexOf(".") < 0 && obj.value != "") {//以上已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额
        if (obj.value.substr(0, 1) == '0' && obj.value.length == 2) {
            obj.value = obj.value.substr(1, obj.value.length);
        }
    }
};

function phonePrivileges(){   //隐藏手机号
    var phonePrivileges=parent.$("#phonePrivileges").val();
    if(phonePrivileges == 2){
        $('#RechargeTable').bootstrapTable('hideColumn', 'customerPhone');
    }
}
$(function () {
    var defaultColunms = Recharge.initColumn();
    var table = new BSTable(Recharge.id, "/recharge/rechargeList", defaultColunms);
    table.setPaginationType("server");
    table.setQueryParams(Recharge.formParams());
    Recharge.table = table.init();
    menuNameHideColumn($("#menuName").val(),'RechargeTable');
    Recharge.naturalDaySearch(1);
    checkDate = function () {Recharge.inquire();};
    $(document).on('click', '#laydate_clear,#laydate_today,#laydate_ok', function () {Recharge.inquire();});
    $("#zoom").click(function () {
        if ($("#zoom > span").hasClass('tabMark')) {
            $("#zoom > span").removeClass('tabMark').html('条件展开');
            $("#zoom > img,.divFlex").toggle();
            $(document).ready(function () {
                $('#RechargeTable').bootstrapTable('resetView', {height: $(window).height() - 76});
            });
        } else {
            $("#zoom > span").addClass('tabMark').html('条件收起');
            $("#zoom > img,.divFlex").toggle();
            $(document).ready(function () {
                $('#RechargeTable').bootstrapTable('resetView', {height: $(window).height() - 137});
            });
        }
    });
    $("#moreBtn").click(function () {
        if ($(this).hasClass('tabMark')) {
            $(this).removeClass('tabMark').nextAll().toggle();
            $(document).ready(function () {
                $('#RechargeTable').bootstrapTable('resetView', {height: $(window).height() - 65});
            });
        } else {
            $(this).addClass('tabMark').nextAll().toggle();
            $(document).ready(function () {
                $('#RechargeTable').bootstrapTable('resetView', {height: $(window).height() - 100});
            });
        }
    });
    $(".buttonBox button").click(function () {
        $(".borderNone").css("border", "none");
    });
    $("#oneChannel").change(function () {
        $("#twoChannel").val('请选择');
        $("#thrChannel").val('请选择');
        Recharge.inquire();
    });
    $("#twoChannel").change(function () {
        $("#thrChannel").val('请选择');
        Recharge.inquire()
    });
    $("#thrChannel").change(function () {
        Recharge.inquire()
    });
    phonePrivileges();
});